package chapter_6;

public class Test4 {

    public static void main(String[] args){
        while(true){
            try{
                checkScore(90);
            }catch (MyException e){
                e.printStackTrace();
                System.out.println("业务异常");
            }catch (Exception e){
                e.printStackTrace();
                System.out.println("系统异常");
            }
            System.out.println("aa");
        }

    }
    public static void checkScore(int score){
        if(score > 100){
            throw new MyException("分数不能超过100");
        }else if( score < 0){
            throw new MyException("分数不能小于0");
        }else{
            System.out.println("您是分数是"+score);
        }
    }
}
